package com.helloworld.springcloud.controller;

import com.helloworld.springcloud.common.CommonResult;
import com.helloworld.springcloud.entity.Payment;
import com.helloworld.springcloud.service.PaymentFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * Copyright (C), XXX 软件公司
 * FileName: OrderFeignController
 * Author:   sisyphus
 * Date:     2021/7/17
 * Description:
 */
@RestController
@RequestMapping("order")
public class OrderFeignController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("selectOne/{id}")
    public CommonResult<Payment> selectOne(@PathVariable("id") Long id){
        return paymentFeignService.selectOne(id);
    }

    @GetMapping("/feign/timeout")
    public String getFeignTimeOut() {
        return paymentFeignService.getFeignTimeOut();
    }
}

